Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add heading/separator support to select and multiselect #364

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

raineorshine
Copy link

@raineorshine raineorshine commented Jun 16, 2022

Add heading property to the choices array to allow non-interactive headings or separators.

The cursor will move around the headings.

Fixes #305

Usage

const result = await prompt({
  choices: [
    { title: 'Heading 1', heading: true },
    { title: 'a', selected: true },
    { title: 'b', selected: true },
    { title: 'c', selected: true },
    { title: 'Heading 2', heading: true },
    { title: 'd', selected: false },
    { title: 'e', selected: false },
    { title: 'f', selected: false },
  ],
  type: 'multiselect',
  message: 'Choose an option',
  hint: 'Headings are not selectable.',
  instructions: false,
})

image

To Do

  • select
  • multiselect
  • automultiselect
  • tests
  • docs

@raineorshine raineorshine changed the title Add heading support to select and multiselect Add heading/separator support to select and multiselect Jun 16, 2022
@raineorshine
Copy link
Author

Let me know if this is something you're interested in. I noticed there were a lot of PR's without responses so I wanted to hold off on further development till I got the go-ahead. Thanks!

@algorlab
Copy link

algorlab commented Dec 3, 2022

Hi @raineorshine, @terkelg,

Is there any update on this feature? When it will be released?

@raineorshine
Copy link
Author

raineorshine commented Dec 4, 2022

The repo owner has not responded to an issue or pull request in over a year, so I wouldn't count on it. Feel free to use the fork though. I use the heading feature in https://github.com/raineorshine/prompts/tree/ncu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Separator in select
2 participants